package com.webchat.client.payment.service;

import com.webchat.common.bean.APIResponseBean;
import com.webchat.common.bean.APIResponseBeanUtil;
import com.webchat.domain.vo.response.UserBaseResponseInfoVO;
import com.webchat.rmi.user.UserServiceClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AccountService {

    @Autowired
    private UserServiceClient userServiceClient;

    /**
     * 获取用户信息
     *
     * @param userId
     * @return
     */
    public UserBaseResponseInfoVO userInfo(String userId) {
        APIResponseBean<UserBaseResponseInfoVO> responseBean = userServiceClient.userInfo(userId);
        if (APIResponseBeanUtil.isOk(responseBean)) {
            return responseBean.getData();
        }
        // TODO
        return null;
    }

    /**
     * 用户账号查询详情
     *
     * @param account
     * @return
     */
    public UserBaseResponseInfoVO queryAccount( String account) {
        APIResponseBean<UserBaseResponseInfoVO> responseBean = userServiceClient.queryAccount(account);
        if (APIResponseBeanUtil.isOk(responseBean)) {
            return responseBean.getData();
        }
        // TODO
        return null;
    }
}
